class Department < ActiveRecord::Base
  attr_accessible :description, :title
  has_many :categories

  def get_department(id)
   Department.find(id)
  end

  def self.model_get_categories_names(id)
  	@cats = Department.find(id).categories
  	@ret = Array.new
  	@cats.each do |cat|
  		@ret << cat.title
  	end
    return @ret
  end

end
